std::rand

From Cppreference

Jump to: navigation, search
Defined in header <cstdlib>

int rand();

Returns a pseudo-random integral value between 0 and RAND_MAX.

srand() should be called before any calls to rand() to initialize the random number generator to random value.

Contents

Parameters

(none)

Return value

pseudo-random integral value between 0 and RAND_MAX.

Example

See also

srand
initializes pseudo-random number generator
(function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages